CREATE TABLE [dbo].[TMPARA_EXTE]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_PLAN_EXTE] [dbo].[TD_VC_003] NOT NULL,
[NU_ANNO] [dbo].[TD_IN_004_ANNO] NULL CONSTRAINT [DF__TMPARA_EX__NU_AN__6166761E] DEFAULT (datepart(year,getdate())),
[DE_PLAN_EXTE] [dbo].[TD_VC_100] NULL,
[NV_INFO_EXTE] [dbo].[TD_IN_001] NOT NULL,
[NV_QUIE_EXTE] [dbo].[TD_VC_040] NOT NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPARA_EX__FE_US__634EBE90] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPARA_EX__FE_US__6442E2C9] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPARA_EXTE] ADD CONSTRAINT [CK__TMPARA_EX__NU_AN__625A9A57] CHECK (([NU_ANNO]>=(0)))
GO
ALTER TABLE [dbo].[TMPARA_EXTE] ADD CONSTRAINT [TMPARA_EXTE_01] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_PLAN_EXTE]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPARA_EXTE] ADD CONSTRAINT [FK1_TMPARA_CONT_A_TMPARA_EXTE] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_CONT] ([CO_EMPR])
GO
